$_xmlrpcs_getCapabilities_doc='This method lists all the capabilites that the XML-RPC server has: the (more or less standard) extensions to the xmlrpc spec that it adheres to';
$_xmlrpcs_getCapabilities_sdoc=array(array('list of capabilities, described as structs with a version number and url for the spec'));
function _xmlrpcs_getCapabilities($server, $m=null)
{
$outAr = $GLOBALS['xmlrpcs_capabilities'];
// NIL extension
if ($GLOBALS['xmlrpc_null_extension']) {
$outAr['nil'] = new xmlrpcval(array(
'specUrl' => new xmlrpcval('http://www.ontosys.com/xml-rpc/extensions.php', 'string'),
'specVersion' => new xmlrpcval(1, 'int')
), 'struct');
}
return new xmlrpcresp(new xmlrpcval($outAr, 'struct'));
}
// listMethods: signature was either a string, or nothing.
$_xmlrpcs_methodSignature_doc='Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)';
$_xmlrpcs_methodSignature_sdoc=array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described'));
function _xmlrpcs_methodSignature($server, $m)
{
// let accept as parameter both an xmlrpcval or string
$_xmlrpcs_multicall_doc = 'Boxcar multiple RPC calls in one request. See http://www.xmlrpc.com/discuss/msgReader$1208 for details';
$_xmlrpcs_multicall_sdoc = array(array('list of response structs, where each struct has the usual members', 'list of calls, with each call being represented as a struct, with members "methodname" and "params"'));
* Add a string to the debug info that can be later seralized by the server
* as part of the response message.
* Note that for best compatbility, the debug string should be encoded using
* the $GLOBALS['xmlrpc_internalencoding'] character set.
* @param string $m
* @access public
*/
function xmlrpc_debugmsg($m)
{
$GLOBALS['_xmlrpc_debuginfo'] .= $m . "\n";
}
class xmlrpc_server
{
/// array defining php functions exposed as xmlrpc methods by this server
var $dmap=array();
/**
* Defines how functions in dmap will be invokde: either using an xmlrpc msg object
* or plain php values.
* valid strings are 'xmlrpcvals', 'phpvals' or 'epivals'
*/
var $functions_parameters_type='xmlrpcvals';
/// controls wether the server is going to echo debugging messages back to the client as comments in response body. valid values: 0,1,2,3
var $debug = 1;
/**
* When set to true, it will enable HTTP compression of the response, in case
* the client has declared its support for compression in the request.
*/
var $compress_response = false;
/**
* List of http compression methods accepted by the server for requests.
* NB: PHP supports deflate, gzip compressions out of the box if compiled w. zlib
*/
var $accepted_compression = array();
/// shall we serve calls to system.* methods?
var $allow_system_funcs = true;
/// list of charset encodings natively accepted for requests
var $accepted_charset_encodings = array();
/**
* charset encoding to be used for response.
* NB: if we can, we will convert the generated response from internal_encoding to the intended one.
* can be: a supported xml encoding (only UTF-8 and ISO-8859-1 at present, unless mbstring is enabled),
* null (leave unspecified in response, convert output stream to US_ASCII),
* 'default' (use xmlrpc library default as specified in xmlrpc.inc, convert output stream if needed),
* or 'auto' (use client-specified charset encoding or same as request if request headers do not specify it (unless request is US-ASCII: then use library default anyway).
* NB: pretty dangerous if you accept every charset and do not have mbstring enabled)
*/
var $response_charset_encoding = '';
/// storage for internal debug info
var $debug_info = '';
/// extra data passed at runtime to method handling functions. Used only by EPI layer
var $user_data = null;
/**
* @param array $dispmap the dispatch map withd efinition of exposed services
* @param boolean $servicenow set to false to prevent the server from runnung upon construction
*/
function xmlrpc_server($dispMap=null, $serviceNow=true)
{
// if ZLIB is enabled, let the server by default accept compressed requests,
// and compress responses sent to clients that support them